package assdraw2.historyagent.presentation;

import java.awt.Dimension;
import java.awt.GridLayout;

import javax.swing.JFrame;
import javax.swing.JList;

import assdraw2.common.PresentationWindowListener;
import assdraw2.historyagent.HistoryControl;

public class HistoryPresentation extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private HistoryControl control;
	private JList list;

	public HistoryPresentation(HistoryControl control) {
		super("Historie");
		this.control = control;

		setResizable(false);
		setLayout(new GridLayout(1, 1));
		// setLayout(new FlowLayout());

		initComponents();

		this.setPreferredSize(new Dimension(500, 600));
		this.pack();
		setLocation(700,100);
		this.setVisible(true);

		addWindowListener(new PresentationWindowListener(control));
	}

	private void initComponents() {
		list = new JList(control.getData());
		add(list);	
	}

	public JList getList(){
		return list;
	}
	
}
